#include "Proxy.h"
#include <iostream>
#include "RealSubject.h"

namespace Proxy{
    Proxy::Proxy() {
        this->subject = new RealSubject{};
    }

    void Proxy::request() {
        this->preRequest();
        this->subject->request();
        this->afterRequest();
    }

    void Proxy::preRequest() {
        std::cout << "before request using proxy" << std::endl;
    }

    void Proxy::afterRequest() {
        std::cout << "after request using proxy" << std::endl;
    }
}
